<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
var arr=[12, 8, 99, 19, 112];

arr.sort(function (n1, n2){
	return n1-n2;
	/*if(n1<n2)
	{
		return -1;
	}
	else if(n1>n2)
	{
		return 1;
	}
	else
	{
		return 0;
	}*/
});

alert(arr);
</script>
</head>

<body>
</body>
</html>
